﻿

''' <summary>
'''  漫画 内容 容器 
''' </summary>
''' <remarks></remarks>
Public Class ComicContent
    Inherits ItemBase



    Sub New(ByVal contentType As ContentType)
        Me._contentType = contentType
        Me._items = New List(Of Picture)
    End Sub


    Protected Sub New(ByVal id As String, ByVal title As String, ByVal image As Uri, ByVal imageMimeType As String, ByVal itemUrl As Uri, ByVal dateCreated As DateTimeOffset, ByVal dateModified As DateTimeOffset, ByVal contentType As ContentType, ByVal comicId As String, ByVal size As Integer, ByVal mimeType As String)
        MyClass.New(id, title, image, imageMimeType, itemUrl, dateCreated, dateModified, contentType, comicId, size, mimeType, New List(Of Picture))
    End Sub
    Protected Sub New(ByVal id As String, _
               ByVal title As String, _
               ByVal image As Uri, _
               ByVal imageMimeType As String, _
               ByVal itemUrl As Uri, _
               ByVal dateCreated As DateTimeOffset, _
               ByVal dateModified As DateTimeOffset, _
               ByVal contentType As ContentType, _
               ByVal comicId As String, _
               ByVal size As Integer, _
               ByVal mimeType As String, _
               ByVal itmes As List(Of Picture))

        MyBase.New(id, title, image, imageMimeType, itemUrl, dateCreated, dateModified)

        Me._contentType = contentType
        Me._comicId = comicId
        Me._size = size
        Me._mimeType = mimeType
        Me._items = Items

    End Sub


   
    ''' <summary>
    ''' 内容类型
    ''' </summary>
    ''' <remarks></remarks>
    ReadOnly _contentType As ContentType


    ''' <summary>
    '''  漫画 ID
    ''' </summary>
    ''' <remarks></remarks>
    Dim _comicId As String


    ''' <summary>
    ''' 大小
    ''' </summary>
    ''' <remarks></remarks>
    Dim _size As Integer
    '

    ''' <summary>
    ''' MIME 类型
    ''' </summary>
    ''' <remarks></remarks>
    Dim _mimeType As String

    ''' <summary>
    '''  内容 图片
    ''' </summary>
    ''' <remarks></remarks>
    Dim _items As List(Of Picture)


    ''' <summary>
    ''' 漫画 ID
    ''' </summary>
    ''' <remarks></remarks>
    Public Property ComicId() As String
        Get
            Return _comicId
        End Get
        Set(ByVal value As String)
            _comicId = value
        End Set
    End Property
    ''' <summary>
    ''' 内容 图片
    ''' </summary>
    ''' <remarks></remarks>
    Public Property Items() As List(Of Picture)
        Get
            Return _items
        End Get
        Set(ByVal value As List(Of Picture))
            _items = value
        End Set
    End Property
    ''' <summary>
    ''' 内容类型
    ''' </summary>
    ''' <remarks></remarks>
    Public ReadOnly Property ItemType() As ContentType
        Get
            Return _contentType
        End Get
    End Property
    ''' <summary>
    ''' MIME 类型
    ''' </summary>
    ''' <remarks></remarks>
    Public Property MimeType() As String
        Get
            Return _mimeType
        End Get
        Set(ByVal value As String)
            _mimeType = value
        End Set
    End Property
    ''' <summary>
    ''' 大小
    ''' </summary>
    ''' <remarks></remarks>
    Public Property Size() As Integer
        Get
            Return _size
        End Get
        Set(ByVal value As Integer)
            _size = value
        End Set
    End Property


    ''' <summary>
    '''  生成 新的 Vol（卷） 容器
    ''' </summary>
    ''' <param name="id">卷ID</param>
    ''' <param name="title">标题</param>
    ''' <param name="image">图片</param>
    ''' <param name="itemUrl">地址</param>
    ''' <param name="dateCreated">创建时间</param>
    ''' <param name="dateModified">修改时间</param>
    ''' <param name="comicId">漫画ID</param>
    ''' <param name="size">大小</param>
    ''' <param name="mimeType">MimeType</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function GenerateVolContent(ByVal id As String, _
                                               ByVal title As String, _
                                               ByVal image As Uri, _
                                               ByVal imageMimeType As String, _
                                               ByVal itemUrl As Uri, _
                                               ByVal dateCreated As DateTimeOffset, _
                                               ByVal dateModified As DateTimeOffset, _
                                               ByVal comicId As String, _
                                               ByVal size As Integer, _
                                               ByVal mimeType As String) As ComicContent

        Return New ComicContent(id, title, image, imageMimeType, itemUrl, dateCreated, dateModified, ContentType.Vol, comicId, size, mimeType)


    End Function

    ''' <summary>
    '''  生成 新的 Chapter（章） 容器
    ''' </summary>
    ''' <param name="id">卷ID</param>
    ''' <param name="title">标题</param>
    ''' <param name="image">图片</param>
    ''' <param name="itemUrl">地址</param>
    ''' <param name="dateCreated">创建时间</param>
    ''' <param name="dateModified">修改时间</param>
    ''' <param name="comicId">漫画ID</param>
    ''' <param name="size">大小</param>
    ''' <param name="mimeType">MimeType</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function GenerateChapterContent(ByVal id As String, _
                                              ByVal title As String, _
                                              ByVal image As Uri, _
                                              ByVal imageMimeType As String, _
                                              ByVal itemUrl As Uri, _
                                              ByVal dateCreated As DateTimeOffset, _
                                              ByVal dateModified As DateTimeOffset, _
                                              ByVal comicId As String, _
                                              ByVal size As Integer, _
                                              ByVal mimeType As String) As ComicContent


        Return New ComicContent(id, title, image, imageMimeType, itemUrl, dateCreated, dateModified, ContentType.Chapter, comicId, size, mimeType)
    End Function



End Class


''' <summary>
''' 内容类型
''' </summary>
''' <remarks></remarks>
Public Enum ContentType
    ''' <summary> 卷 </summary>
    Vol
    ''' <summary>章</summary>
    Chapter

End Enum
